package it.globalgamejam.scar.menu.stuff 
{
	import it.globalgamejam.dsm.menu.IntroWorld;
	import it.globalgamejam.scar.Assets;
	import it.globalgamejam.scar.game.GameWorld;
	import it.globalgamejam.scar.game.Puzzle;
	import it.globalgamejam.scar.Main;
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.utils.Input;
	
	/**
	 * ...
	 * @author N1xx1
	 */
	public class PlayGame extends Entity
	{
		
		public function PlayGame(x:Number, y:Number) 
		{
			super(x, y);
			
			graphic = new Image(Assets.START);
			Image(graphic).originX = 64;
			Image(graphic).originY = 80;
			
			setHitbox(280, 128, 32, 40);
		}
		
		public override function update():void {
			super.update();
			
			if (Input.mouseDown) {
				if (collidePoint(x, y, world.mouseX, world.mouseY)) {
					graphic = new Image(Assets.START_HOVER);
					Image(graphic).originX = 64;
					Image(graphic).originY = 80;
				}
			} else if (Input.mouseReleased) {
				if (collidePoint(x, y, world.mouseX, world.mouseY)) {
					Main.instance.startGame();
					FP.world = new IntroWorld();
					//FP.world = new GameWorld(GameWorld.levels[GameWorld.currentLevel = 3]);
				}
			}
		}
		
	}

}